/*
package com.milo.web.controller.sms;

import com.milo.common.dto.AjaxResult;
import com.milo.common.enums.SmsEnum;
import com.milo.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

*/
/**
 * 短信验证码
 * @author milogenius
 * @date 2019/10/24 11:17
 *
 *//*

@Controller
@RequestMapping("sms")
@Slf4j
public class SmsController {

    @RequestMapping("toIndexPage.html")
    public String toIndexPage(){
        return "sms/sms.html";
    }

    */
/**
     * 发送语音短信验证码(只给异网用户发送)
     * @param request
     * @return 发送结果
     * @see SmsController#checkVoiceCode(HttpServletRequest)  校验验证码方法
     *//*

    @RequestMapping(value = "sendVoiceCode.do",method = RequestMethod.POST)
    @ResponseBody
    public AjaxResult  sendVoiceCode(HttpServletRequest request) {
        AjaxResult result = new AjaxResult();
        try {
            //手机号码
            String phoneNumber = StringUtils.isEmpty(request.getParameter("phoneNumber")) ? "" : request.getParameter("phoneNumber").trim();
            //业务编码
            String busiNum =  StringUtils.isEmpty(request.getParameter("busiNum")) ? "" : request.getParameter("busiNum").trim();

            log.info("快递宝异网短信发送的请求参数手机号码: " + phoneNumber+",业务编码:"+busiNum);
            //必要参数非空校验
            if (StringUtils.isEmpty(phoneNumber)||StringUtils.isEmpty(busiNum)) {
                return AjaxResult.fail(SmsEnum.DEFICIENCY_PARAM.getDesc());
            }
            //TODO 调用接口发送短信
            //result = smsValidService.sendVoiceCode(phoneNumber, busiNum);
            if (SmsEnum.SUCCESS.getStatus().equals(result.getCode())) {
                //发送成功
                return result;
            } else {
                result = AjaxResult.fail("失败");
            }

        } catch (Exception e) {
            result = AjaxResult.fail(SmsEnum.INTERFACE_SERVICE_ERROR.getDesc());
            log.error("短信验证码失败");
            e.printStackTrace();
        }
        return result;
    }




    */
/**
     * 语音短信验证码校验
     * @param request
     * @return 校验结果
     * @see SmsController#sendVoiceCode(HttpServletRequest) 发送语音验证码
     *//*

    @ResponseBody
    @RequestMapping(value = "checkVoiceCode.do",method = RequestMethod.POST)
    public AjaxResult checkVoiceCode(HttpServletRequest request) {
        AjaxResult result = new AjaxResult();
        try {
            //验证码内容
            String verCode = StringUtils.isEmpty(request.getParameter("verCode")) ? "" : request.getParameter("verCode").trim();
            //手机号码
            String phoneNumber = StringUtils.isEmpty(request.getParameter("phoneNumber")) ? "" : request.getParameter("phoneNumber").trim();
            //业务编码
            String busiNum =  StringUtils.isEmpty(request.getParameter("busiNum")) ? "" : request.getParameter("busiNum").trim();

            log.info("快递宝语音短信验证码校验参数验证码："+verCode+":电话号码:"+phoneNumber+":业务编码:"+busiNum);
            //必要参数非空校验
            if (StringUtils.isEmpty(verCode) || StringUtils.isEmpty(phoneNumber) || StringUtils.isEmpty(busiNum)) {
                return AjaxResult.fail(SmsEnum.DEFICIENCY_PARAM.getDesc());
            }
            //短信验证码校验调用公共类SmsValidUtil
            //result = smsValidService.checkVoiceCode(phoneNumber, verCode, busiNum);
            if (SmsEnum.SUCCESS.getStatus().equals(result.getCode())) { //发送成功
                result = AjaxResult.success(SmsEnum.SUCCESS.getDesc());
            } else {
                result = AjaxResult.success(SmsEnum.FAIL.getDesc());
            }
        } catch (Exception e) {
            log.error("==> 快递宝发送短信验证码失败");
            e.printStackTrace();
        }
        return result;
    }
}
*/
